<%--
  Created by IntelliJ IDEA.
  User: shisjin
  Date: 2023/10/10
  Time: 15:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
  request.setAttribute("info","这是request的值");
  session.setAttribute("info","这是session的值");
  application.setAttribute("info","这是application的值");
  //通过pageContext获取页面的内置对象取值
   out.print(pageContext.getRequest().getAttribute("info")) ;
   out.print("<br>");
    out.print(pageContext.getSession().getAttribute("info")) ;
    out.print("<br>");
    out.print(pageContext.getServletContext().getAttribute("info")) ;
    out.print("<br>");
    out.print("<br>");
    out.print(pageContext.getAttribute("info",1)) ;
    out.print("<br>");
    out.print(pageContext.getAttribute("info",2)) ;
    out.print("<br>");
    out.print(pageContext.getAttribute("info",3)) ;
    out.print("<br>");
    out.print(pageContext.getAttribute("info",4)) ;

%>

</body>
</html>
